<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class MY_Model extends CI_Model {

    public $table;

    public function select(){
        return $this->db->get($this->table)->result_array();
    }
 
    public function get_one(){
        return $this->db->get($this->table)->row_array();
    }

    //统计
    public function get_count(){
        return $this->db->count_all_results($this->table);
    }

    //添加
    public function create($data){
        return $this->db->insert($this->table,$data);
    }
    //修改
    public function update($data){
        return $this->db->update($this->table,$data);
    }
    
    //删除
    public function delete(){
        return $this->db->delete($this->table);
    }

}

/* End of file MY_Model.php */
/* Location: ./application/core/MY_Model.php */